//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using System.Web.UI.WebControls;
using CommunityServer.Components;

namespace CommunityServer.Controls
{
	/// <summary>
	/// Summary description for TitleHeader.
	/// </summary>
	public class TitleHeader : TemplatedWebControl
	{
        private IText _mainTitle = null;
        private IText _subTitle = null;

		public TitleHeader()
		{
		
		}

        protected override void AttachChildControls()
        {
            _mainTitle = FindText("MainTitle");
            _subTitle = FindText("SubTitle");
        }

        protected override void OnPreRender(EventArgs e)
        {
            if(_mainTitle != null)
                _mainTitle.Text = ResourceManager.GetString(Title);

            if(_subTitle != null)
                _subTitle.Text = ResourceManager.GetString(SubTitle);

            base.OnPreRender (e);
        }


        public string Title
        {
            get
            { return ViewState["Title"] as string; }
            set
            {  ViewState["Title"] = value; }
        }

        /// <summary>
        /// Property SubTitle (string)
        /// </summary>
        public string SubTitle
        {
            get
            { return ViewState["SubTitle"] as string; }
            set
            {  ViewState["SubTitle"] = value; }
        }

	}
}
